<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .container{ 
            --borderColor:#03a9f3;
            position: relative;
            border: 1px solid #03a9f3;
            width: 200px;
            height: 200px;
        }

        .container::before,
        .container::after{
            content:'';
            position: absolute;
            width: 20px;
            height: 20px;
            /*动画效果放到这里写*/
            transition: .3s ease-in-out;
        
        }

        .container::before{
            top: -5px;
            left: -5px;
            border-top: 1px solid var(--borderColor);
            border-left: 1px solid var(--borderColor);
           
        }

        .container::after{
            right: -5px;
            bottom: -5px;
            border-bottom:1px solid var(--borderColor);
            border-right:1px solid var(--borderColor);
        }

        .container:hover::before,
        .container:hover::after{
            width: calc(100% + 9px);
            height: calc(100% + 9px);

        }



        
    </style>
</head>
<body>
    <div class="container">

    </div>
</body>
</html>